package cn.z2huo.knowledge.concurrency.thinkinginjava.section_21_3.syncCodeBlock;

class PairChecker implements Runnable {

    private final BasePairManager pairManager;

    public PairChecker(BasePairManager pairManager) {
        this.pairManager = pairManager;
    }

    @Override
    public void run() {
        while (true) {
            pairManager.checkCounter.incrementAndGet();
            pairManager.getPair().checkState();
        }
    }

}
